%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Contents: style of kc thesis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% kcthesis.tex
%
%                                                      by Cao, Chen
%                                                     ken.ccao@gmail.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Copyright 2009 Cao, Chen <ken.ccao@gmail.com>
% 
%   This document is free; you can redistribute it and/or modify it
%   under the terms of the GNU General Public License as published by
%   the Free Software Foundation; either version 2 of the License, or
%   (at your option) any later version.
% 
%   This document is distributed in the hope that it will be useful, but
%   WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%   General Public License for more details.
% 
%   You should have received a copy of the GNU General Public License
%   along with this document; if not, write to the Free Software
%   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% meta info
\def\filedate{2009/05/01}
\def\fileversion{0.01}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{kcthesis}[\filedate\space\fileversion\space]

\usepackage{kcdoc}
\usepackage{epsfig}

\renewcommand{\baselinestretch}{1.5}
\def\defaultfont{\renewcommand{\baselinestretch}{1.5}
\fontsize{12pt}{13pt}\selectfont}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% fonts
\newcommand{\gkai}{\CJKfamily{gkai}}
\newcommand{\hei}{\CJKfamily{gkai}}

\newcommand{\fnto}{\fontsize{32}{40}\selectfont}    % 小初, 1.5倍行距
\newcommand{\fnti}{\fontsize{26}{36}\selectfont}    % 一号, 1.4倍行距
\newcommand{\fntis}{\fontsize{24}{36}\selectfont}
\newcommand{\fntii}{\fontsize{22}{28}\selectfont}    % 二号, 1.25倍行距
\newcommand{\fntiis}{\fontsize{18}{18}\selectfont}    % 小二, 单倍行距
\newcommand{\fntiii}{\fontsize{16}{24}\selectfont}    % 三号, 1.5倍行距
\newcommand{\fntiiis}{\fontsize{15}{22}\selectfont}    % 小三, 1.5倍行距
\newcommand{\fntiv}{\fontsize{14}{21}\selectfont}     % 四号, 1.5倍行距
\newcommand{\fntivhs}{\fontsize{13}{19.5}\selectfont} % 半小四, 1.5倍行距
\newcommand{\fntivs}{\fontsize{12}{18}\selectfont}    % 小四, 1.5倍行距
\newcommand{\fntvb}{\fontsize{11}{11}\selectfont}    % 大五号, 单倍行距
\newcommand{\fntv}{\fontsize{10.5}{10.5}\selectfont}    % 五号, 单倍行距


\def\ctitle#1{\def\@ctitle{#1}}\def\@ctitle{}
\def\cbtitle#1{\def\@cbtitle{#1}}\def\@cbtitle{}
\def\cdegree#1{\def\@cdegree{#1}}\def\@cdegree{}
\def\caffil#1{\def\@caffil{#1}}\def\@caffil{}
\def\csubject#1{\def\@csubject{#1}}\def\@csubject{}
\def\cauthor#1{\def\@cauthor{#1}}\def\@cauthor{}
\def\cnumber#1{\def\@cnumber{#1}}\def\@cnumber{}
\def\csubsub#1{\def\@csubsub{#1}}\def\@csubsub{}
\def\csupervisor#1{\def\@csupervisor{#1}}\def\@csupervisor{}
\def\cassosupervisor#1{\def\@cassosupervisor{~ & 副指导教师 & ：& #1\\}}\def\@cassosupervisor{}
\def\ccosupervisor#1{\def\@ccosupervisor{~ & 联\hfill合\hfill导\hfill师 & ：& #1\\}}\def\@ccosupervisor{}
\def\cdate#1{\def\@cdate{#1}}\def\@cdate{}
\long\def\cabstract#1{\long\def\@cabstract{#1}}\long\def\@cabstract{}
\def\ckeywords#1{\def\@ckeywords{#1}}\def\@ckeywords{}

\def\etitle#1{\def\@etitle{#1}}\def\@etitle{}
\def\ebtitle#1{\def\@ebtitle{#1}}\def\@ebtitle{}
\def\edegree#1{\def\@edegree{#1}}\def\@edegree{}
\def\eaffil#1{\def\@eaffil{#1}}\def\@eaffil{}
\def\esubject#1{\def\@esubject{#1}}\def\@esubject{}
\def\eauthor#1{\def\@eauthor{#1}}\def\@eauthor{}
\def\esupervisor#1{\def\@esupervisor{#1}}\def\@esupervisor{}
\def\eassosupervisor#1{\def\@eassosupervisor{Associate Supervisor: & #1\\}}\def\@eassosupervisor{}
\def\ecosupervisor#1{\def\@ecosupervisor{~ & #1\\}}\def\@ecosupervisor{}
\def\edate#1{\def\@edate{#1}}\def\@edate{}
\long\def\eabstract#1{\long\def\@eabstract{#1}}\long\def\@eabstract{}
\def\ekeywords#1{\def\@ekeywords{#1}}\def\@ekeywords{}

\def\copyright{
    \newpage
    \thispagestyle{empty}
    \begin{center}

    \parbox[t][6cm][c]{\textwidth} {\Huge%
    \begin{center} {\hei 版权声明} \end{center} }

    \parbox[t][3cm][c]{\textwidth}{\large
    \hspace{2em}任何收存和保管本论文各种版本的单位和个人，
    未经本论文作者同意，不得将本论文转借他人，亦不得随意复制、抄录、拍照或以任何方式传播。
    否则，引起有碍作者著作权之问题，将可能承担法律责任。
    }
    \end{center}

    \cleardoublepage
}

\def\makecover{
    \begin{titlepage}
    %中文封面%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \newpage
    \thispagestyle{empty}
    \begin{center}
    %
    \begin{figure}[htb!]
    \centerline{\epsfig{file=logo.eps,width=0.7\columnwidth,clip=}}
    \end{figure}
    
%    \parbox[t][0mm][t]{\textwidth}{
%    \begin{center}  \end{center} }
    
%    \begin{figure}[htb!]
%    \centerline{\epsfig{file=bt.eps,width=0.6\columnwidth,clip=}}
%    \end{figure}
    
%    \parbox[t][7mm][t]{\textwidth}{
%    \begin{center}  \end{center} }
%
%    \parbox[t][5cm][c]{\textwidth}{\fnto \gkai
%    \begin{center} {
%    \bf 南京大学}\end{center} }
    
    \parbox[t][3cm][c]{\textwidth} {\fnto%
    \begin{center} {%
    \hei \@cdegree学位论文} \end{center} }

    \parbox[t][25mm][c]{\textwidth} {%
    \begin{center} {\Large %
    {题目：\underline{\@ctitle}}} {\large%
    \parbox[t][7mm][c]{0.7\textwidth} {
    \flushright------\@cbtitle
    } }%
    \end{center} }

    \parbox[t][10mm][t]{\textwidth}{
    \begin{center}  \end{center} }

    \parbox[t][70mm][c]{\textwidth}{ {\large
    \begin{center}
    \begin{tabular}{ccl@{\extracolsep{2em}}l}
    ~ & 姓\hfill\hfill名 & ：& \@cauthor\\
    ~ & 学\hfill\hfill号 & ：& \@cnumber\\
    ~ & 院\hfill\hfill系 & ：& \@caffil\\
    ~ & 专\hfill\hfill业 & ：& \@csubject\\
%    ~ & 研~究~方~向 & ：& \@csubsub\\
    \hspace{20mm} & 导~师~姓~名 & ：& \@csupervisor
    \end{tabular} \end{center} } }

    \parbox[t][30mm][b]{\textwidth}{
    \begin{center} {\Large \gkai \@cdate} \end{center} }
%
    \end{center}
%
%    % 封二 空白页
%    \cleardoublepage
%
%%    ~~~\vspace{1em}
%
%%    \thispagestyle{empty}
%
%    % 英文封面
%    %\newpage
%
%    %\thispagestyle{empty}
%
%    %\begin{center}
%
%    %\parbox[t][3cm][c]{\textwidth}{\erhao
%    %\begin{center} {\textbf{\textsf{\@etitle}}}\end{center} }
%
%    %\parbox[t][2cm][t]{\textwidth}{
%    %\begin{center}  \end{center} }
%
%    %\parbox[t][3cm][c]{\textwidth}{\begin{center} {\sanhao \textbf{By} } \end{center}
%    %\begin{center} {\sanhao \textbf{\@eauthor} } \end{center}
%    %{\xiaosan
%    %\begin{center}
%    %\begin{tabular}{rl}
%    %Dissertation Supervisor: & \@esupervisor\\
%    %\@ecosupervisor
%    %\@eassosupervisor
%    %\end{tabular}
%    %\end{center} }}
%
%    %\parbox[t][5cm][c]{\textwidth}{
%    %\begin{center} {\sanhao A Dissertation Presented
%    %to the\\FACULTY OF THE GRADUATE SCHOOL\\PEKING UNIVERSITY } \end{center} }
%
%    %\parbox[t][5cm][c]{\textwidth}{
%    %\begin{center} {\sanhao In Partial Fulfillment of the
%    %Requirement\\for the Degree of\\\textbf{\textsf{\@edegree}\\(\@esubject)}} \end{center}
%    %}
%
%    %\parbox[t][2cm][b]{\textwidth}{
%    %\begin{center} {\sanhao \textbf{\textsf{\@edate}}} \end{center} }
%
    %\end{center}

    \clearpage
    \end{titlepage}
}

\def\makeabstract{
    %Abstract and keywords%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \addcontentsline{toc}{chapter}{摘要}
    \markboth{中~文~摘~要}{中~文~摘~要}
    \begin{center}
    \hei{\LARGE 摘要}
    \end{center}
    
%    \addcontentsline{toc}{chapter}{摘要}

    \defaultfont

    \@cabstract

    \vspace{1em}

    \noindent {\hei 关键词：}\@ckeywords

    \clearpage

    \defaultfont

    \newpage
    %\chapter*{}

    \addcontentsline{toc}{chapter}{\hei ABSTRACT（英文摘要）}
    \markboth{英~文~摘~要}{英~文~摘~要}
    
    \begin{center} {\fntiii \textbf{\textsf{\@etitle}:\@ebtitle}\\
    \fntiv \@eauthor(\@esubject)\\
    Directed by \@esupervisor}\end{center}
    
%    \addcontentsline{toc}{chapter}{\hei ABSTRACT（英文摘要）}
    
    \renewcommand{\baselinestretch}{1.5}
    \fontsize{12pt}{12pt}\selectfont
    \@eabstract

    \vspace{1em}

    \noindent {\textbf{Key Words:}} \quad \@ekeywords
    \clearpage
}

\long\def\statement{
    \newpage
    \thispagestyle{empty}

    \defaultfont

    %\chapter*{北京大学学位论文原创性声明和使用授权说明}
    %\markboth{原创性声明和使用授权说明}{原创性声明和使用授权说明}
    %\addcontentsline{toc}{chapter}{\hei原创性声明和使用授权说明}

    \begin{center}
    \parbox[t][2cm][c]{\textwidth}{ {\fntiii \centerline {\hei{北京大学学位论文原创性声明和使用授权说明}}}}

    \parbox[t][2cm][c]{\textwidth}{ {\fntiv \centerline {\hei{原创性声明}}}}

    \parbox[t][3cm][c]{\textwidth}{ {\fntivs
    \hspace{2em}本人郑重声明： 所呈交的学位论文，是本人在导师的指导
    下，独立进行研究工作所取得的成果。除文中已经注明引用的内容外，
    本论文不含任何其他个人或集体已经发表或撰写过的作品或成果。对本
    文的研究做出重要贡献的个人和集体，均已在文中以明确方式标明。本
    声明的法律结果由本人承担。}}

    \parbox[t][1cm][b]{\textwidth}{{\fntivs \hspace{5cm}
    论文作者签名：\hfill 日期：~~~~~~年~~~~月~~~~日}}

    \end{center}

    \begin{center}
    \parbox[t][4cm][c]{\textwidth}{ {\fntiv \centerline
    {\hei{学位论文使用授权说明}} } }

    \parbox[t][3cm][c]{\textwidth}{\fntivs
    \hspace{2em}本人完全了解北京大学关于收集、保存、使用学位论文的规定，即：\\
    \hspace*{2em} 按照学校要求提交学位论文的印刷本和电子版本；\\
    \hspace*{2em} 学校有权保存学位论文的印刷本和电子版，并提供目录检索与阅览服务；\\
    \hspace*{2em} 学校可以采用影印、缩印、数字化或其它复制手段保存论文；\\
    \hspace*{2em} 在不以赢利为目的的前提下，学校可以公布论文的部分或全部内容。 }

    \parbox[t][3cm][c]{\textwidth}{\fntivhs
    \hspace{2em}\hei {（保密的论文在解密后应遵守此规定）} }

    \parbox[t][2cm][c]{\textwidth}{\fntivs \hspace{4cm}
    论文作者签名：\hfill 导师签名：\hfill \hspace{1cm}
    \\ \hspace*{6cm} 日期：~~~~~~~~年~~~~~月~~~~~日\hspace{1cm} }

    \end{center}
    \cleardoublepage
}

